import yaml
from typing import Dict, Any

class ConfigLoader:
    def __init__(self, config_path: str):
        self.config = self._load_config(config_path)

    def _load_config(self, path: str) -> Dict[str, Any]:
        try:
            with open(path, 'r') as f:
                return yaml.safe_load(f)
        except FileNotFoundError:
            raise RuntimeError(f"Config file not found: {path}")
        except yaml.YAMLError as e:
            raise RuntimeError(f"Invalid YAML format: {str(e)}")

    def get(self, key: str, default=None) -> Any:
        return self.config.get(key, default)